package com.itbaizhan.config;

import lombok.Data;

import org.springframework.boot.context.properties.ConfigurationProperties;

/*读取application.yml里的数据源配置
* 第二个数据库,slave
*项目启动会把数据源放进spring容器中
* 在主启动类添加@EnableConfigurationProperties，否则@ConfigurationProperties会报错
 * @EnableConfigurationProperties(value = {DBConfig1.class, DBConfig2.class})*/

@Data
@ConfigurationProperties(prefix = "spring.datasource.dynamic.datasource.slave")
public class DBConfig2 {
    private String url;
    private String username;
    private String password;
    private String driverClassName;
}
